package com.leave.service;

import com.leave.dao.AdminDao;
import com.leave.entity.Admin;
import com.leave.entity.Classes;

import java.util.List;

public class AdminService {
    private AdminDao adminDao;
    public boolean check(String id,String password){
        boolean flag=false;
        Admin admin1=new Admin();
        admin1.setUserid(id);
        admin1.setPassword(password);
//        System.out.println(id+password);
        List<Admin> list =adminDao.query(admin1);
        flag =!list.isEmpty();
        return flag;
    }

    public List<Admin> adminList(Admin admin){
        List<Admin> adminList = null;
        adminList = adminDao.query(admin);
        return adminList;
    }

    public boolean editAdmin(Admin admin) {
        adminDao.update(admin);
        return true;
    }

    public void setAdminDao(AdminDao adminDao) {
        this.adminDao=adminDao;
    }
}
